//
//  JYTNFCOperate.h
//  JYTNFCCore
//
//  Created by 九爷 on 2024/1/17.
//

#import <Foundation/Foundation.h>

/*
 @brief NFC读卡结果回调
 BOOL isSuccess 是否成功
 NSString *errorStr 错误描述
 NSString *cardNo 卡号
 NSString *balance 余额
 NSString *cityCode 所属城市代码
 BOOL isNormalCard 是否正常卡
 NSString *cardStatusStr 卡状态中文描述
 BOOL userCancel 是否用户取消
 */
typedef void(^JYTNFCReadCardComplation)(BOOL isSuccess, NSString *errorStr, NSString *cardNo, NSString *balance, NSString *cityCode, BOOL isNormalCard, NSString *cardStatusStr, BOOL userCancel);

/*
 @brief NFC充值写卡结果回调
 BOOL isSuccess 是否成功
 NSString *errorStr 错误描述
 NSString *balance 充值后余额
 NSString *isGaryTrade 是否是灰交易
 NSString *chargeFee 充值金额
 BOOL userCancel 是否用户取消
 */
typedef void(^JYTNFCWriteCardComplation)(BOOL isSuccess, NSString *errorStr, NSString *balance, BOOL isGaryTrade, NSString *chargeFee, BOOL userCancel);

@interface JYTNFCOperate : NSObject

/*
 @brief 配置是否是开发环境
 
 @param isDebugEnv YES 开发环境 NO 生产环境
 */
+ (void)isDebugEnv:(BOOL)isDebugEnv;

/*
 @brief 判断是否能用NFC功能
 
 @return YES 支持  NO 不支持
 */
+ (BOOL)canUseNfc;

/*
 @brief 读取IC卡信息
 
 @param JYTNFCReadCardComplation 读取结果回调
 */
- (void)jytReadCard:(JYTNFCReadCardComplation)complation;

/*
 @brief 充值IC卡
 
 @param JYTNFCWriteCardComplation 写卡结果回调
 */
- (void)jytWriteCardWithRechargeFee:(NSString *)rechargeFee orderId:(NSString *)orderId cardNo:(NSString *)cardNo complation:(JYTNFCWriteCardComplation)complation;

/*
 @brief 重置IC卡充值
 
 @param JYTNFCWriteCardComplation 写卡结果回调
 */
- (void)jytRevertCard:(JYTNFCWriteCardComplation)complation;

@end
